define("@widget/MESSAGING/bs-Component-5c8ab323.js",["radpack","exports","@wsb/guac-widget-shared@^1/lib/components/Recaptcha/badge","@wsb/guac-widget-shared@^1/lib/common/constants/traffic2","@wsb/guac-widget-shared@^1/lib/common/constants/form/formIdentifiers"],function(e,a,o,r,t){"use strict";var l=(global.keyMirror||guac.keymirror)({MESSAGING_FAB:null,MESSAGING_MESSAGE_FLYOUT:null,WELCOME_MESSAGE:null,SEND_MESSAGE_TO:null,EMAIL_OPT_IN_TOGGLE:null,EMAIL_OPT_IN_MESSAGE:null,COLOR_SATURATION_KNOB:null,COLOR_HUE_SLIDER_KNOB:null});const s=(global.React||guac.react).createElement("path",{d:"M0.342304 14.5C7.35025 6.3293 3.35025 0.829295 0 0.0.0 0.0 5.4 2.1 32.3502 0.329295C32.3503 3.8293 -3.13481 20.7261 0.342304 14.5Z"});function p({text:e}){return(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Block,{category:"neutral",section:"overlay",style:{backgroundColor:"neutral",margin:"-medium medium medium medium",borderRadius:"5px",position:"relative"}},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Text,{style:{padding:"12px 15px",borderRadius:"5px",backgroundColor:"primaryOverlay",fontSize:"16px",color:"neutral"}},e),(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Icon,{icon:s,size:24,style:{width:"33px",height:"16px",color:"primaryOverlay",position:"absolute",top:"100%",left:"3px",marginTop:"-1px"}}))}function c({title:e,message:a,children:o,onClose:r}){return(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Block,{"data-aid":l.MESSAGING_MESSAGE_FLYOUT,style:{"-webkit-overflow-scrolling":"touch",overflowX:"hidden",overflowY:"auto",boxShadow:"0px 3px 18px rgba(0, 0, 0, 0.25)",backgroundColor:"neutral",borderRadius:"5px",borderWidth:"xsmall",borderStyle:"solid",borderColor:"#fff",width:"382px",marginBottom:"small",position:"absolute",maxHeight:"calc(100vh - 105px)",right:"-1px",bottom:"100%","@xs-only":{maxHeight:"100vh",height:"100vh",zIndex:"inherit",position:"fixed",left:"0",top:"0",bottom:"89px",width:"100%"}}},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Block,{"data-field-id":"formEmail"},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Icon,{onClick:r,icon:"close",size:22,style:{color:"#fff",position:"absolute",top:"18px",right:"14px",cursor:"pointer","@sm":{display:"none"}}}),(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Heading,{style:{color:"action",fontSize:"large",backgroundColor:"action",paddingTop:"small",paddingBottom:a?"xlarge":"small",paddingLeft:"medium",paddingRight:"medium",margin:a?"0":"0 0 medium 0",textAlign:"left","@md":{textAlign:"left"}}},e),a?(global.React||guac.react).createElement(p,{text:a}):null,(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Block,{style:{overflow:"hidden",padding:"0 medium"}},o)))}p.propTypes={text:(global.PropTypes||guac["prop-types"]).string.isRequired},c.propTypes={title:(global.PropTypes||guac["prop-types"]).string.isRequired,message:(global.PropTypes||guac["prop-types"]).string.isRequired,children:(global.PropTypes||guac["prop-types"]).node.isRequired,onClose:(global.PropTypes||guac["prop-types"]).func.isRequired};const{renderModes:n}=(global.Core||guac["@wsb/guac-widget-core"]).constants,g="reamazejs-container";function i(e){const{position:a,prompt:o,promptEnabled:r,starter1:t,starter2:l,starter3:s,starter4:p,starter5:c,color:i,reamazeBrandId:u,reamazeWrap:d,reamazeJsSource:b,reamazeCookieJsSource:m,cookieBannerEnabled:y,faqEnabled:w=!0,allowBotProcessing:f,confirmationMessage:E,avatar:T,forceShowFlyout:P,renderMode:S,embeddableSlug:R}=e,[z,C]=(global.React||guac.react).useState(!0),[_,I]=(global.React||guac.react).useState(!0),h=(e,a,o,r,t,l)=>({mode:"notification",delay:S===n.EDIT?0:10,text:e,primary:a||null,primary2:o||null,primary3:r||null,primary4:t||null,primary5:l||null}),M=(e,a)=>{e.forEach(e=>{const o=e.addedNodes[0];if(o?.id===g&&S===n.EDIT&&d?.current)return d.current.append(o),void a.disconnect()})};return(global.React||guac.react).useEffect(()=>{if(S===n.EDIT){const e=document.getElementById(g);if(void 0!==window.reamaze&&e)d.current.append(e);else{const e={childList:!0};new MutationObserver(M).observe(document.body,e)}}const e=(e=>{const a=e.createElement("script");return a.src=S!==n.EDIT&&y?m:b,a.async=!0,a.type="text/javascript",a})(document);return document.body.appendChild(e),window._support={account:u,openPopup:P,ui:{contactMode:"default",enableKb:`${w}`,styles:{widgetColor:i},widget:{icon:"webChat",label:!(!(r||t||l||s||p||c)||S===n.EDIT)&&h(o,t,l,s,p,c),position:a,slug:R,allowBotProcessing:"true"===String(f)},shoutboxFacesMode:"brand-avatar",overrides:{confirmationMessage:E}},user:{authpath:`/m/api/reamaze/v2/customers/auth?brand=${u}`},apps:{faq:{enabled:`${w}`},recentConversations:{},orders:{}},_preview:P},()=>{void 0!==window.reamaze&&S===n.EDIT&&(window._support.ui.widget=!1,window._support.openPopup=!1,window._support._preview=!1,window.reamaze.reload());const e=document.querySelector(`script[src='${b}']`);e&&e.remove();const a=document.getElementById(g);a&&a.remove()}},[]),(global.React||guac.react).useEffect(()=>{S===n.EDIT&&(window._support.ui.widget.position=a,window._support.ui.styles={widgetColor:i},window._support.ui.shoutboxFacesMode="brand-avatar",window._support.openPopup=P,window._support._preview=P,window._support._route=null,window._support.ui.widget.label=!1,void 0!==window.reamaze&&window.reamaze.reload())},[a,i,T,P]),(global.React||guac.react).useEffect(()=>{S===n.EDIT&&(z?C(!1):(window._support.ui.widget.label=!(!r||!P)&&h(o,t,l,s,p,c),window._support.openPopup=!1,void 0!==window.reamaze&&window.reamaze.reload()))},[o,r,t,l,s,p,c]),(global.React||guac.react).useEffect(()=>{S===n.EDIT&&(_?I(!1):(window._support._route="conversations:show",window._support._routeParams={slug:"*mock_confirm_convo*"},window._support.ui.overrides.confirmationMessage=E,window._support.openPopup=P,window._support._preview=P,void 0!==window.reamaze&&window.reamaze.reload()))},[E]),(global.React||guac.react).createElement("div",null)}i.propTypes={position:(global.PropTypes||guac["prop-types"]).string,prompt:(global.PropTypes||guac["prop-types"]).string,promptEnabled:(global.PropTypes||guac["prop-types"]).bool,starter1:(global.PropTypes||guac["prop-types"]).string,starter2:(global.PropTypes||guac["prop-types"]).string,starter3:(global.PropTypes||guac["prop-types"]).string,starter4:(global.PropTypes||guac["prop-types"]).string,starter5:(global.PropTypes||guac["prop-types"]).string,color:(global.PropTypes||guac["prop-types"]).string,reamazeBrandId:(global.PropTypes||guac["prop-types"]).string,reamazeJsSource:(global.PropTypes||guac["prop-types"]).string,reamazeCookieJsSource:(global.PropTypes||guac["prop-types"]).string,reamazeWrap:(global.PropTypes||guac["prop-types"]).node,faqEnabled:(global.PropTypes||guac["prop-types"]).bool,allowBotProcessing:(global.PropTypes||guac["prop-types"]).string,confirmationMessage:(global.PropTypes||guac["prop-types"]).string,avatar:(global.PropTypes||guac["prop-types"]).string,forceShowFlyout:(global.PropTypes||guac["prop-types"]).bool,renderMode:(global.PropTypes||guac["prop-types"]).string,cookieBannerEnabled:(global.PropTypes||guac["prop-types"]).bool,embeddableSlug:(global.PropTypes||guac["prop-types"]).string};const u={contactApi:/[?&]contactApiVersion=([^&]*)/};function d(e="contactApi"){if("undefined"==typeof window)return"";const{location:{search:a=""}}=window||{},o=u[e].exec(a);return o&&o[1]?`${o[1]}.`:""}const b="EMAIL",m="CONVERSATIONS",{utils:{TCCLUtils:y}}=(global.Core||guac["@wsb/guac-widget-core"]).UX2,{MESSAGING_EMAIL:w,MESSAGING_CONVERSATIONS:f}=t.default,{Z_INDEX_COOKIE_BANNER:E,Z_INDEX_FULL_SCREEN_OVERLAY:T,Z_INDEX_STICKY_NAV:P}=(global.Core||guac["@wsb/guac-widget-core"]).constants.layers,{renderModes:S}=(global.Core||guac["@wsb/guac-widget-core"]).constants,R=({keyName:e})=>"phone"!==e,z=(global.React||guac.react).lazy(()=>new Promise(function(a,o){e.require(["@wsb/guac-widget-shared@^1/lib/components/Form"],a,o)})),C={marginBottom:"medium",display:"block",textAlign:"center",color:"action"};function _(e){const{id:a,section:t,forceShowFlyout:s,welcomeMessage:p,config:n,formFields:g,formSuccessMessage:u,emailOptInEnabled:_,emailOptInMessage:I,notificationPreference:h,recaptchaType:M,emailConfirmationMessage:x,locale:v,websiteId:A,accountId:B,domainName:k,staticContent:N,isReseller:O,businessName:G,reamazeBrandId:L,reamazePrompt:U,reamazeStarter1:F,reamazeStarter2:X,reamazeStarter3:q,reamazeStarter4:D,reamazeStarter5:J,reamazePromptEnabled:H,reamazeThemeColor:j,reamazePosition:V,reamazeEmbeddableSlug:W,reamazeConfirmationMessage:Z,reamazeAvatarImage:K,reamazeFaqEnabled:Y=!0,reamazeAllowBotProcessing:$,renderMode:Q,cookieBannerEnabled:ee}=e,ae=(global.React||guac.react).useRef(!1),[oe,re]=(global.React||guac.react).useState(s),[te,le]=(global.React||guac.react).useState(e.isMobile),se=Q===(global.Core||guac["@wsb/guac-widget-core"]).constants.renderModes.PUBLISH,pe=()=>re(!oe);(global.React||guac.react).useEffect(()=>{const e=window.document?.body;e&&se&&(te&&oe?e.classList.add("disable-scroll"):e.classList.remove("disable-scroll"))},[oe,te]),(global.React||guac.react).useEffect(()=>{oe!==s&&re(s)},[s]),(global.React||guac.react).useEffect(()=>{ae.current?re(!0):ae.current=!0},[p,u,_,I]);const ce=h===b?g.filter(R):g,ne=h===b?w:f,ge=(global.React||guac.react).useRef(null);return(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Block,{category:"neutral",section:t,style:{position:"fixed",right:"medium",bottom:"medium",zIndex:oe?T:E-1,width:"65px",height:"65px","@md":{zIndex:oe?P+1:E-1}}},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX.MatchMedia,{onChange:a=>{const o=se&&a?"xs"===a.size:e.isMobile;le(o)}}),Q!==S.PREVIEW&&"REAMAZE"===h&&L&&(global.React||guac.react).createElement("div",{ref:ge},(global.React||guac.react).createElement(i,{position:V,prompt:U,promptEnabled:H,starter1:F,starter2:X,starter3:q,starter4:D,starter5:J,color:j,reamazeBrandId:L,reamazeWrap:ge,reamazeJsSource:n.reamazeJsSource,reamazeCookieJsSource:n.reamazeCookieJsSource,confirmationMessage:Z,avatar:K,forceShowFlyout:s,cookieBannerEnabled:ee,faqEnabled:Y,allowBotProcessing:$,renderMode:Q,embeddableSlug:W})),[b,m].includes(h)&&(global.React||guac.react).createElement((global.React||guac.react).Fragment,null,oe?(global.React||guac.react).createElement(c,{title:G,message:p,onClose:pe},"undefined"!=typeof window?(global.React||guac.react).createElement((global.React||guac.react).Suspense,{fallback:(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Block,{style:C},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Loader,{size:"medium"}))},(global.React||guac.react).createElement(z,{locale:v,websiteId:A,accountId:B,domainName:k,staticContent:N,emailConfirmationMessage:x,emailOptInEnabled:_,emailOptInMessage:I,formSuccessMessage:u,formSubmitEndpoint:n.formSubmitEndpoint,formSubmitHost:n.formSubmitHost.replace("{{SHA}}",d()),formFields:ce,formIdentifier:ne,recaptchaType:M,recaptchaEnabled:Boolean(M),isReseller:O,category:"neutral",pageId:"00000000-0000-0000-0000-000000000000",widgetId:a,renderMode:Q,dataAidPrefix:"MESSAGING"})):null):(global.React||guac.react).createElement(o.default,null),(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Block,{"data-aid":l.MESSAGING_FAB,"data-field-id":te||s?null:"enabled","data-edit-interactive":"true",onClick:pe,"data-traffic2":oe?r.default.editor_preview.messaging_fab_close:r.default.editor_preview.messaging_fab_open,"data-tccl":y.getTCCLString({eid:oe?"ux2.messaging.fab.close":"ux2.messaging.fab.open",type:"click"}),style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:oe?"#555":"action",boxShadow:"0px 3px 18px rgba(0, 0, 0, 0.25)",transform:"translateZ(0)"}},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Icon,{style:{color:oe?"#fff":"action"},icon:oe?"close":"chat",size:oe?34:44}))))}_.propTypes={forceShowFlyout:(global.PropTypes||guac["prop-types"]).bool,businessName:(global.PropTypes||guac["prop-types"]).string,reamazeBrandId:(global.PropTypes||guac["prop-types"]).string,welcomeMessage:(global.PropTypes||guac["prop-types"]).string,formSuccessMessage:(global.PropTypes||guac["prop-types"]).string,emailOptInMessage:(global.PropTypes||guac["prop-types"]).string,emailOptInEnabled:(global.PropTypes||guac["prop-types"]).bool,section:(global.PropTypes||guac["prop-types"]).string,domainName:(global.PropTypes||guac["prop-types"]).string,cookieBannerEnabled:(global.PropTypes||guac["prop-types"]).bool,config:(global.PropTypes||guac["prop-types"]).shape({formSubmitEndpoint:(global.PropTypes||guac["prop-types"]).string,formSubmitHost:(global.PropTypes||guac["prop-types"]).string,reamazeJsSource:(global.PropTypes||guac["prop-types"]).string,reamazeCookieJsSource:(global.PropTypes||guac["prop-types"]).string}),formFields:(global.PropTypes||guac["prop-types"]).array,accountId:(global.PropTypes||guac["prop-types"]).string.isRequired,websiteId:(global.PropTypes||guac["prop-types"]).string.isRequired,id:(global.PropTypes||guac["prop-types"]).string,staticContent:(global.PropTypes||guac["prop-types"]).object.isRequired,locale:(global.PropTypes||guac["prop-types"]).string,emailConfirmationMessage:(global.PropTypes||guac["prop-types"]).string,recaptchaType:(global.PropTypes||guac["prop-types"]).string,isMobile:(global.PropTypes||guac["prop-types"]).bool,notificationPreference:(global.PropTypes||guac["prop-types"]).string,isReseller:(global.PropTypes||guac["prop-types"]).bool,reamazePrompt:(global.PropTypes||guac["prop-types"]).string,reamazePromptEnabled:(global.PropTypes||guac["prop-types"]).bool,reamazeStarter1:(global.PropTypes||guac["prop-types"]).string,reamazeStarter2:(global.PropTypes||guac["prop-types"]).string,reamazeStarter3:(global.PropTypes||guac["prop-types"]).string,reamazeStarter4:(global.PropTypes||guac["prop-types"]).string,reamazeStarter5:(global.PropTypes||guac["prop-types"]).string,reamazeThemeColor:(global.PropTypes||guac["prop-types"]).string,reamazePosition:(global.PropTypes||guac["prop-types"]).string,reamazeEmbeddableSlug:(global.PropTypes||guac["prop-types"]).string,reamazeConfirmationMessage:(global.PropTypes||guac["prop-types"]).string,reamazeAvatarImage:(global.PropTypes||guac["prop-types"]).string,reamazeFaqEnabled:(global.PropTypes||guac["prop-types"]).bool,reamazeAllowBotProcessing:(global.PropTypes||guac["prop-types"]).string,renderMode:(global.PropTypes||guac["prop-types"]).string},a.default=_,Object.defineProperty(a,"__esModule",{value:!0})}),"undefined"!=typeof window&&(window.global=window); //# sourceMappingURL=bs-Component-5c8ab323.js.map